#ifndef _NE_MESH_FILE_FORMAT_H_
#define _NE_MESH_FILE_FORMAT_H_

#include <neinit.h>

namespace ne
{
    const uint32_t MESH_FILE_MAGIC_NUMBER = 0x1222;
    const uint32_t MESH_FILE_VERSION = 1;
    const uint32_t MAX_STRING_LENGTH_IN_MESH_FILE = 0x80;

    struct MeshHeader
    {
        uint32_t mMagicNum;
        uint32_t mVersion;
        // Mesh info
        char mName[MAX_STRING_LENGTH_IN_MESH_FILE];
        char mMaterialName[MAX_STRING_LENGTH_IN_MESH_FILE];
        // Vertex Data info
        uint32_t mPrimitiveType;
        uint32_t mStride;
        // Vertex Attribute info
        uint32_t mNumAttribute;
        uint32_t mAttributeOffset;
        // Vertex Buffer info
        uint32_t mVertexBufferOffset;
        uint32_t mVertexBufferSize;
        // SubMesh info
        uint32_t mNumSubMesh;
        uint32_t mSubMeshOffset;
        // Index Buffer info
        uint32_t mIndexBufferOffset;
        uint32_t mIndexBufferSize;
    };

    struct SubMeshHeader
    {
        // SubMesh info
        char mName[MAX_STRING_LENGTH_IN_MESH_FILE];
        char mMaterialName[MAX_STRING_LENGTH_IN_MESH_FILE];
        // Index Data info
        uint32_t mPrimitiveType;
        uint32_t mType;
        uint32_t mCount;
        uint32_t mOffset;
    };
}

#endif
